package com.agent.logbean;

import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * Created by fangjicai on 2020/5/31.
 * 日志对象
 */
@Data
public class WebLogBean implements Serializable {
    /**
     * 浏览器信息
     */
    private String browserInfo;
    /**
     * 请求URL
     */
    private String requestURL;
    /**
     *  请求类型(get、post、put、delete等)
     */
    private String httpMethod;
    /**
     * 客户端请求IP
     */
    private String requestIP;
    /**
     * 请求参数
     */
    private String requestParam;
    /**
     * 请求参数
     */
    private Object[] requestParams;
    /**
     * 操作的类和方法
     */
    private String operateClassMethod;
    /**
     * 耗时
     */
    private long consumeTime;
    /***
     * 响应结果
     */
    private String responseResult;
    /**
     * 操作描述
     */
    private String operateDesc;
    /**
     * 异常信息
     */
    private String exceptionMsg;
    /**
     * 操作时间
     */
    private Date operateTime;

    @Override
    public String toString() {
        return String.format("WebLogBean[browserInfo='%s',requestURL='%s',httpMethod='%s'," +
                        "requestIP='%s',requestParams='%s',operateClassMethod='%s',consumeTime=%d," +
                        "responseResult='%s',operateDesc='%s',exceptionMsg='%s',operateTime=%d",
                browserInfo,requestURL,httpMethod,requestIP,requestParams,operateClassMethod,consumeTime,
                responseResult,operateDesc,exceptionMsg,operateTime);
    }
}
